/**
 *@auther: tang
 *@Date: 2020-11-18
 *Project: group-booking-shop-manage-system
 */
const {createProxyMiddleware} = require("http-proxy-middleware");
module.exports = function(app){
  app.use(
      createProxyMiddleware("/loginApi",{
        target:"http://47.110.60.226:9999",
        changeOrigin:true,
        pathRewrite:{
          "^/loginApi":""
        }
      })
  )
  app.use(
      createProxyMiddleware("/yapiSer",{
        target:"http://123.57.67.148:3000/mock/879",
        changeOrigin:true,
        pathRewrite:{
          "^/yapiSer":""
        }
      })
  )
  app.use(
      createProxyMiddleware("/ipApi",{
        target:"http://pv.sohu.com",
        changeOrigin:true,
        pathRewrite:{
          "^/ipApi":""
        }
      })
  )
  app.use(
      createProxyMiddleware("/test",{
        target:"http://172.16.6.210:8000",
        changeOrigin:true,
        pathRewrite:{
          "^/test":""
        }
      })
  )
  app.use(
      createProxyMiddleware("/api",{
        target:"http://47.96.0.211:9000",
        changeOrigin:true,
        pathRewrite:{
          "^/api":""
        }
      })
  )
}